package de.szut.ita13sommerfeld.blockadventure.level;

import java.awt.image.BufferedImage;
import java.io.IOException;

import javax.imageio.ImageIO;

public class BufferedLoader {

	private BufferedImage level;
	private BufferedImage texture;
	
	public static final String LEVEL_PATH = "/Level/lvl";
	public static final String LEVEL_EXTANSION = ".png";
	
	public BufferedImage loadLevel(int levelindex) {
		try {
			level = ImageIO.read(getClass().getResource(String.valueOf(LEVEL_PATH + levelindex + LEVEL_EXTANSION)));
		} catch (IOException e) {
			e.printStackTrace();
		}
		return level;
	}
	
	public BufferedImage loadTexture(String path) {
		try {
			texture = ImageIO.read(getClass().getResource(path));
		} catch (IOException e) {
			e.printStackTrace();
		}
		return texture;
	}
	
}
